.class public final Lcom/estrongs/android/taskmanager/PreferencesActivity;
.super Landroid/preference/PreferenceActivity;


# instance fields
.field a:Landroid/preference/CheckBoxPreference;

.field b:Landroid/preference/CheckBoxPreference;

.field c:Landroid/preference/CheckBoxPreference;


# direct methods
.method public constructor <init>()V
    .locals 0

    invoke-direct {p0}, Landroid/preference/PreferenceActivity;-><init>()V

    return-void
.end method

.method public static a(Landroid/content/Context;Z)V
    .locals 6

    const/16 v5, 0x2710

    const/4 v4, 0x0

    const-string v0, "notification"

    invoke-virtual {p0, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/app/NotificationManager;

    invoke-virtual {v0, v5}, Landroid/app/NotificationManager;->cancel(I)V

    if-nez p1, :cond_0

    :goto_0
    return-void

    :cond_0
    new-instance v1, Landroid/app/Notification;

    invoke-direct {v1}, Landroid/app/Notification;-><init>()V

    const v2, 0x7f02005b

    iput v2, v1, Landroid/app/Notification;->icon:I

    iget v2, v1, Landroid/app/Notification;->flags:I

    or-int/lit8 v2, v2, 0x4

    iput v2, v1, Landroid/app/Notification;->flags:I

    iget v2, v1, Landroid/app/Notification;->flags:I

    or-int/lit8 v2, v2, 0x20

    iput v2, v1, Landroid/app/Notification;->flags:I

    new-instance v2, Landroid/content/Intent;

    const-string v3, "android.intent.action.PICK_TASK_MANAGER"

    invoke-direct {v2, v3}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    const/high16 v3, 0x40

    invoke-virtual {v2, v3}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;

    invoke-static {p0, v4, v2, v4}, Landroid/app/PendingIntent;->getActivity(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;

    move-result-object v2

    const v3, 0x7f070010

    invoke-virtual {p0, v3}, Landroid/content/Context;->getText(I)Ljava/lang/CharSequence;

    move-result-object v3

    const v4, 0x7f070011

    invoke-virtual {p0, v4}, Landroid/content/Context;->getText(I)Ljava/lang/CharSequence;

    move-result-object v4

    invoke-virtual {v1, p0, v3, v4, v2}, Landroid/app/Notification;->setLatestEventInfo(Landroid/content/Context;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Landroid/app/PendingIntent;)V

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v2

    iput-wide v2, v1, Landroid/app/Notification;->when:J

    invoke-virtual {v0, v5, v1}, Landroid/app/NotificationManager;->notify(ILandroid/app/Notification;)V

    goto :goto_0
.end method

.method public static b(Landroid/content/Context;Z)V
    .locals 4

    const/4 v3, 0x1

    invoke-virtual {p0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v0

    new-instance v1, Landroid/content/ComponentName;

    const-class v2, Lcom/estrongs/android/taskmanager/AutoStartReceiver;

    invoke-direct {v1, p0, v2}, Landroid/content/ComponentName;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    if-eqz p1, :cond_0

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2, v3}, Landroid/content/pm/PackageManager;->setComponentEnabledSetting(Landroid/content/ComponentName;II)V

    :goto_0
    return-void

    :cond_0
    const/4 v2, 0x2

    invoke-virtual {v0, v1, v2, v3}, Landroid/content/pm/PackageManager;->setComponentEnabledSetting(Landroid/content/ComponentName;II)V

    goto :goto_0
.end method


# virtual methods
.method protected onCreate(Landroid/os/Bundle;)V
    .locals 2

    invoke-super {p0, p1}, Landroid/preference/PreferenceActivity;->onCreate(Landroid/os/Bundle;)V

    const v0, 0x7f050002

    invoke-virtual {p0, v0}, Lcom/estrongs/android/taskmanager/PreferencesActivity;->addPreferencesFromResource(I)V

    const-string v0, "stat_enabled"

    invoke-virtual {p0, v0}, Lcom/estrongs/android/taskmanager/PreferencesActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v0

    check-cast v0, Landroid/preference/CheckBoxPreference;

    iput-object v0, p0, Lcom/estrongs/android/taskmanager/PreferencesActivity;->a:Landroid/preference/CheckBoxPreference;

    iget-object v0, p0, Lcom/estrongs/android/taskmanager/PreferencesActivity;->a:Landroid/preference/CheckBoxPreference;

    new-instance v1, Lcom/estrongs/android/taskmanager/fo;

    invoke-direct {v1, p0}, Lcom/estrongs/android/taskmanager/fo;-><init>(Lcom/estrongs/android/taskmanager/PreferencesActivity;)V

    invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V

    iget-object v0, p0, Lcom/estrongs/android/taskmanager/PreferencesActivity;->a:Landroid/preference/CheckBoxPreference;

    invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z

    move-result v0

    invoke-static {p0, v0}, Lcom/estrongs/android/taskmanager/PreferencesActivity;->a(Landroid/content/Context;Z)V

    const-string v0, "auto_start"

    invoke-virtual {p0, v0}, Lcom/estrongs/android/taskmanager/PreferencesActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v0

    check-cast v0, Landroid/preference/CheckBoxPreference;

    iput-object v0, p0, Lcom/estrongs/android/taskmanager/PreferencesActivity;->b:Landroid/preference/CheckBoxPreference;

    iget-object v0, p0, Lcom/estrongs/android/taskmanager/PreferencesActivity;->b:Landroid/preference/CheckBoxPreference;

    new-instance v1, Lcom/estrongs/android/taskmanager/fp;

    invoke-direct {v1, p0}, Lcom/estrongs/android/taskmanager/fp;-><init>(Lcom/estrongs/android/taskmanager/PreferencesActivity;)V

    invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V

    const-string v0, "shortcut"

    invoke-virtual {p0, v0}, Lcom/estrongs/android/taskmanager/PreferencesActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v0

    check-cast v0, Landroid/preference/CheckBoxPreference;

    iput-object v0, p0, Lcom/estrongs/android/taskmanager/PreferencesActivity;->c:Landroid/preference/CheckBoxPreference;

    iget-object v0, p0, Lcom/estrongs/android/taskmanager/PreferencesActivity;->c:Landroid/preference/CheckBoxPreference;

    new-instance v1, Lcom/estrongs/android/taskmanager/fq;

    invoke-direct {v1, p0}, Lcom/estrongs/android/taskmanager/fq;-><init>(Lcom/estrongs/android/taskmanager/PreferencesActivity;)V

    invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V

    return-void
.end method
